home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 7 / BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso / Files / Prog / T / Thinkcup.cpt / TCL Update / TCL Update Diffs / CError.c.Diff / CError.c.Diff
Encoding:
Text File  |  1990-03-02  |  7.4 KB  |  164 lines  |  [TEXT/MPS ]

  1. File #1: Roy G. Biv:THINK C ƒ:LSC:THINK Class Library:Core Classes:Core Sources:CError.c
  2. File #2: Roy G. Biv:THINK C ƒ:C patch:old files:CError.c
  3.  
  4. Extra lines in 1st before 20 in 2nd (File "Roy G. Biv:THINK C ƒ:LSC:THINK Class Library:Core Classes:Core Sources:CError.c"; Line 20:23; File "Roy G. Biv:THINK C ƒ:C patch:old files:CError.c"; Line Δ20)
  5.   20    /* Altered by TCL Weaver version 1.0 (2/21/90) */
  6.   21    
  7.   22    #include "CStaticText.h"
  8.   23    
  9.  
  10.  
  11. Extra lines in 1st before 25 in 2nd (File "Roy G. Biv:THINK C ƒ:LSC:THINK Class Library:Core Classes:Core Sources:CError.c"; Line 29:33; File "Roy G. Biv:THINK C ƒ:C patch:old files:CError.c"; Line Δ25)
  12.   29    /* Altered by TCL Weaver version 1.0 (2/21/90) */
  13.   30    
  14.   31    extern Boolean      gHasWNE;            /* Is WaitNextEvent implemented?    */
  15.   32    extern long         gSleepTime;         /* Max time between events          */
  16.   33    
  17.  
  18.  
  19. Extra lines in 1st before 38 in 2nd (File "Roy G. Biv:THINK C ƒ:LSC:THINK Class Library:Core Classes:Core Sources:CError.c"; Line 47:48; File "Roy G. Biv:THINK C ƒ:C patch:old files:CError.c"; Line Δ38)
  20.   47        /* Altered by TCL Weaver version 1.0 (2/21/90) */
  21.   48        
  22.  
  23.  
  24. Extra lines in 1st before 42 in 2nd (File "Roy G. Biv:THINK C ƒ:LSC:THINK Class Library:Core Classes:Core Sources:CError.c"; Line 53:54; File "Roy G. Biv:THINK C ƒ:C patch:old files:CError.c"; Line Δ42)
  25.   53        long                oldA5 = SetCurrentA5();
  26.   54        
  27.  
  28.  
  29. Extra lines in 2nd before 61 in 1st (File "Roy G. Biv:THINK C ƒ:LSC:THINK Class Library:Core Classes:Core Sources:CError.c"; Line Δ61; File "Roy G. Biv:THINK C ƒ:C patch:old files:CError.c"; Line 48:49)
  30.   48        SetUpA5();                          /* We need access to our globals    */
  31.   49        
  32.  
  33.  
  34. Extra lines in 2nd before 63 in 1st (File "Roy G. Biv:THINK C ƒ:LSC:THINK Class Library:Core Classes:Core Sources:CError.c"; Line Δ63; File "Roy G. Biv:THINK C ƒ:C patch:old files:CError.c"; Line 52:53)
  35.   52        RestoreA5();                        /* Reset original A5                */
  36.   53        
  37.  
  38.  
  39. Extra lines in 1st before 57 in 2nd (File "Roy G. Biv:THINK C ƒ:LSC:THINK Class Library:Core Classes:Core Sources:CError.c"; Line 66:67; File "Roy G. Biv:THINK C ƒ:C patch:old files:CError.c"; Line Δ57)
  40.   66        
  41.   67        SetA5(oldA5);
  42.  
  43.  
  44. Extra lines in 1st before 108 in 2nd (File "Roy G. Biv:THINK C ƒ:LSC:THINK Class Library:Core Classes:Core Sources:CError.c"; Line 119:122; File "Roy G. Biv:THINK C ƒ:C patch:old files:CError.c"; Line Δ108)
  45.  119    
  46.  120        /* Altered by TCL Weaver version 1.0 (2/21/90) */
  47.  121        
  48.  122        Str255              errorString;
  49.  
  50.  
  51. Extra lines in 1st before 115 in 2nd (File "Roy G. Biv:THINK C ƒ:LSC:THINK Class Library:Core Classes:Core Sources:CError.c"; Line 130:142; File "Roy G. Biv:THINK C ƒ:C patch:old files:CError.c"; Line Δ115)
  52.  130        
  53.  131        /* Altered by TCL Weaver version 1.0 (2/21/90) */
  54.  132        
  55.  133        if (errMsg == NULL)
  56.  134        
  57.  135            if (macErr == resNotFound)
  58.  136                MissingResources();
  59.  137                
  60.  138            else {
  61.  139                CopyPString((StringPtr)"\pMac OS Error encountered", errorString);
  62.  140                errMsg = NewHandle(errorString[0] + 1L);
  63.  141                CopyPString(errorString, (StringPtr) *errMsg);
  64.  142            }
  65.  
  66.  
  67. Extra lines in 1st file (File "Roy G. Biv:THINK C ƒ:LSC:THINK Class Library:Core Classes:Core Sources:CError.c"; Line 227:320; File "Roy G. Biv:THINK C ƒ:C patch:old files:CError.c"; Line 198Δ)
  68.  227    
  69.  228    /* Altered by TCL Weaver version 1.0 (2/21/90) */
  70.  229    
  71.  230    
  72.  231    /******************************************************************************
  73.  232     MissingResources
  74.  233    
  75.  234            We tried to load two non-existent resources.  Probably, there is no
  76.  235            resource file called "<ProjectFileName>.rsrc" in the project folder.
  77.  236     ******************************************************************************/
  78.  237    
  79.  238    void    CError::MissingResources()
  80.  239    {
  81.  240        typedef struct {            /* Template for a DITL consisting of one    */
  82.  241            short   numItems;       /* static text item.                        */
  83.  242            Handle  itemHandle;
  84.  243            Rect    itemRect;
  85.  244            short   itemTypeAndLength;  /* Type in high byte, length in low byte.   */
  86.  245            Str255  itemContent;        /* Actually, this needs to be pure text     */
  87.  246                                        /* (no length byte).  Also, the number of   */
  88.  247                                        /* chars must be even.                      */
  89.  248                                        
  90.  249        } textItem, *textItemP, **textItemH;            
  91.  250        
  92.  251        Str255  theText;
  93.  252        short   theTextLength,
  94.  253                TextTopLeft = 20,
  95.  254                DialogRight = 255,
  96.  255                DialogBottom = 115;
  97.  256        long    textItemType = (statText + itemDisable) * 0x0100;
  98.  257        
  99.  258        textItemP   theDialogTextP;
  100.  259        textItemH   theDialogText;
  101.  260        DialogPtr   theDialog;
  102.  261        Rect        theDialogRect;
  103.  262        Boolean     eventReceived;
  104.  263        EventRecord macEvent;
  105.  264        
  106.  265        CopyPString((StringPtr) "\pome resources were not found.  Is there a resource file named '<ProjectFileName>.rsrc' in your project folder? ",
  107.  266                    theText);
  108.  267        theTextLength = theText[0] + 1L;
  109.  268        
  110.  269        theDialogText = (textItemH) NewHandle(sizeof(textItem));
  111.  270        HLock(theDialogText);
  112.  271        theDialogTextP = *theDialogText;
  113.  272        
  114.  273        theDialogTextP->numItems = 0;       /* To indicate one item.    */
  115.  274        theDialogTextP->itemHandle = NULL;  /* Just a placeholder.      */
  116.  275        
  117.  276        SetRect(&theDialogTextP->itemRect, 
  118.  277                TextTopLeft, TextTopLeft, DialogRight, DialogBottom);
  119.  278        
  120.  279        theDialogTextP->itemTypeAndLength = textItemType + theTextLength;
  121.  280        CopyPString(theText, theDialogTextP->itemContent);
  122.  281        
  123.  282        theDialogTextP->itemContent[0] = 'S';   /* Replace length byte with 'S' */
  124.  283        
  125.  284        theDialogTextP->itemContent[30] = CARRIAGE_RETURN;  /* Replace these    */
  126.  285        theDialogTextP->itemContent[31] = CARRIAGE_RETURN;  /* spaces with CRs  */
  127.  286        theDialogTextP->itemContent[62] = CARRIAGE_RETURN;
  128.  287        theDialogTextP->itemContent[95] = CARRIAGE_RETURN;
  129.  288        
  130.  289        SetRect(&theDialogRect, 0, 0, DialogRight, DialogBottom);
  131.  290        
  132.  291        /* Center the dialog in the upper portion of the screen. */
  133.  292        
  134.  293        theDialogRect.left = (screenBits.bounds.right - 
  135.  294                                (theDialogRect.right - theDialogRect.left)) / 2;
  136.  295        theDialogRect.top = (screenBits.bounds.bottom - 
  137.  296                                (theDialogRect.bottom - theDialogRect.top)) / 3;
  138.  297                                
  139.  298        if (theDialogRect.top < (GetMBarHeight() + 7))
  140.  299            theDialogRect.top = GetMBarHeight() + 7;
  141.  300            
  142.  301        theDialogRect.right += theDialogRect.left;  /* left and top were both 0 */
  143.  302        theDialogRect.bottom += theDialogRect.top;
  144.  303        
  145.  304        theDialog = NewDialog(NULL, &theDialogRect, "", TRUE, dBoxProc, (Ptr) -1L, FALSE,
  146.  305                              0, theDialogText);
  147.  306        SysBeep(1);
  148.  307        DrawDialog(theDialog);
  149.  308        
  150.  309        /* Dismiss dialog on keyDown or mouseDown */
  151.  310        
  152.  311        do  {
  153.  312                SystemTask();
  154.  313                eventReceived = GetOSEvent(mDownMask + keyDownMask, &macEvent);
  155.  314            }
  156.  315        while (eventReceived == FALSE);
  157.  316        
  158.  317        DisposDialog(theDialog);
  159.  318        gApplication->Exit();
  160.  319        ExitToShell();
  161.  320    }
  162.  
  163. *** EOF on both files ***
  164.